﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MuaChung.Models.AccDetailModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    EditAccount
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        EditAccount</h2>
        <div id="Message">
            <%: ViewData["Message"] %>
        </div>
    <% using (Html.BeginForm())
       {%>
    <%: Html.ValidationSummary(true) %>
    <fieldset>
        <legend>Chi tiết tài khoản</legend>
        <table>
            <tr>
                <td class="editor-label">
                    Mã tài khoản
                </td>
                <td class="editor-field">
                    <%: Html.DisplayFor(model => model.uid) %>
                    <%: Html.HiddenFor(model => model.uid) %>
                    <%: Html.ValidationMessageFor(model => model.uid) %>
                </td>
            </tr>
            <tr>
                <td class="editor-label">
                    Tên đăng nhập
                </td>
                <td class="editor-field">
                    <%: Html.TextBoxFor(model => model.UserName) %>
                    <%: Html.ValidationMessageFor(model => model.UserName) %>
                </td>
            </tr>
            <tr>
                <td class="editor-label">
                    <%: Html.LabelFor(model => model.Email) %>
                </td>
                <td class="editor-field">
                    <%: Html.TextBoxFor(model => model.Email) %>
                    <%: Html.ValidationMessageFor(model => model.Email) %>
                </td>
            </tr>
            <tr>
                <td class="editor-label">
                    Trạng thái
                </td>
                <td class="editor-field">
                    <select id="status" name="status">
                        <% if (Model.status == "Activated")
                           { %>
                               <option selected=selected value="Activated">Đã kích hoạt</option>
                               <option value="Inactive">Chưa kích hoạt</option> 
                        <% }
                           else
                           {%>
                               <option value="Activated">Đã kích hoạt</option>
                               <option selected=selected value="Inactive">Chưa kích hoạt</option>
                          <%} %>
                        
                    </select>
                    <%: Html.ValidationMessageFor(model => model.status) %>
                </td>
            </tr>
            <tr>
                <td class="editor-label">
                    Quyền hạn
                </td>
                <td class="editor-field">
                    <select id="role" name="role">
                        <% if (Model.role == "Admin")
                           { %>
                                <option selected=selected value="Admin">Admin</option>
                                <option value="Manager">Manager</option>
                                <option value="Customer">Customer</option>
                        <% }
                           else if (Model.role == "Manager")
                           {%>
                               <option value="Admin">Admin</option>
                               <option selected=selected value="Manager">Manager</option>
                               <option value="Customer">Customer</option>
                         <%}
                           else
                           {%>
                               <option value="Admin">Admin</option>
                               <option value="Manager">Manager</option>
                               <option selected=selected value="Customer">Customer</option>
                         <%} %>
                        
                    </select>
                    <%: Html.ValidationMessageFor(model => model.role) %>
                </td>
            </tr>
            <tr>
                <td class="editor-label">
                    Ngày đăng ký
                </td>
                <td class="editor-field">
                    <%: Html.DisplayFor(model => model.ngayDK, String.Format("{0:g}", Model.ngayDK)) %>
                    <%: Html.HiddenFor(model => model.ngayDK, String.Format("{0:g}", Model.ngayDK)) %>
                    <%: Html.ValidationMessageFor(model => model.ngayDK) %>
                </td>
            </tr>
            <tr>
                <td class="editor-label">
                    Họ tên
                </td>
                <td class="editor-field">
                    <%: Html.TextBoxFor(model => model.HoTen) %>
                    <%: Html.ValidationMessageFor(model => model.HoTen) %>
                </td>
            </tr>
            <tr>
                <td class="editor-label">
                    Ngày sinh
                </td>
                <td class="editor-field">
                    <%: Html.EditorFor(model => model.NgaySinh, String.Format("{0:g}", Model.NgaySinh)) %>
                    <%: Html.ValidationMessageFor(model => model.NgaySinh) %>
                </td>
            </tr>
            <tr>
                <td class="editor-label">
                    Số điện thoại
                </td>
                <td class="editor-field">
                    <%: Html.TextBoxFor(model => model.SDT) %>
                    <%: Html.ValidationMessageFor(model => model.SDT) %>
                </td>
            </tr>
            <tr>
                <td class="editor-label">
                    Địa chỉ
                </td>
                <td class="editor-field">
                    <%: Html.TextBoxFor(model => model.DiaChi) %>
                    <%: Html.ValidationMessageFor(model => model.DiaChi) %>
                </td>
            </tr>
            <tr>
                <td class="editor-label">
                    Số CMND
                </td>
                <td class="editor-field">
                    <%: Html.TextBoxFor(model => model.CMND) %>
                    <%: Html.ValidationMessageFor(model => model.CMND) %>
                </td>
            </tr>
        </table>
        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
    <% } %>
    <div>
        <%: Html.ActionLink("Trở lại danh sách", "ListAllAccount") %>
    </div>
</asp:Content>
